#ifdef __cplusplus
extern "C" {
#endif


#include "MenuItem.h"
#include "MenuService.h"

void __begheader(MenuItem, addCommand)
	Command * _tCommand
	__begbody
	MenuService * menuService = __instance(MenuService)
	unsigned int position = __voidfun(menuService, MenuService, generate)
	_tCommand->mID = position;
	__begfun(&(menuService->mCommands), VectorCommand, pushBack)
	    _tCommand
	__endfun
	::AppendMenu(__this(MenuItem)->mHandle, MF_STRING, position, _tCommand->mText);
__endbody

void __begheader(MenuItem, addItem)
	MenuItem * _tMenuItem
__begbody
	::AppendMenu(__this(MenuItem)->mHandle, MF_STRING | MF_POPUP, (unsigned int)(_tMenuItem->mHandle), _tMenuItem->mText);
__endbody


void __begvoid(MenuItem, initialize)
__begbody
    __this(MenuItem)->mHandle = ::CreatePopupMenu();
__endbody



#ifdef __cplusplus
}
#endif
